/* vim: set expandtab tabstop=4 shiftwidth=4: */

var browserVersion = parseInt(navigator.appVersion);
var isNetscape = navigator.appName.indexOf("Netscape") != -1;
var isIE = navigator.appName.indexOf("Microsoft") != -1;
var agent = navigator.userAgent.toLowerCase();
var isWindows = agent.indexOf("win") != -1;
var isMac = agent.indexOf("mac") != -1;
var isNix = agent.indexOf("X11") != -1;

function doConfirm(text)
{
    var val = confirm(text);
    return (!val) ? false : true;
}

function fixSidebar()
{
    //if ($('#sidebar').height() < $('#pageContent').height()) {
    //    $('#sidebar').height($('#pageContent').height() - 19);
    //}
	
	if ($('#contentContainer').height() > 699) {
		$('#contentContainer').height($('#contentContainer').height());
		$('#sidebar').height($('#contentContainer').height() - 57);
	} else if ($('#sidebar').height() < 642) {
		$('#sidebar').height(642);
	}
}

function backgroundPositionX(obj) {
    var pos = $(obj).css("background-position");
    if (pos == 'undefined' || pos == null) {
        pos = $(obj).css("background-position-x");
    } else {
        pos = pos.split(" ")[0];
    }
    return pos.replace('px', '') || 0;
}

function backgroundPositionY(obj) {
    var pos = $(obj).css("background-position");
    if (pos == 'undefined' || pos == null) {
        pos = $(obj).css("background-position-y");
    } else {
        pos = pos.split(" ")[1];
    }
    return pos.replace('px', '') || 0;
}